<?php

/**
* gerenciaHtml
*
* Classe para o gerenciamento do html. Responsavel pela abertura das Tags principais
* @author Rafael Garbin e Luiz Teixeira
* @version 2008.12.05
*/
class gerenciaHtml
{
	/**
	* getBeginHtml
	*
	* Seta as tags de abertura do html
	* @param String title
	* @param String bgColor
	* @param String js
	* @param String css
	* @param String backGround
	* @return String
	* @access public
	*/
	function getBeginHtml($title, $bgColor="", $js=array(), $css=array(), $backGround="") 
	{		   
		$html = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
	
		$html .= " <HTML xmlns='http://www.w3.org/1999/xhtml'>"
				." 	<HEAD>"
				." 		<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1' />"
				."		<TITLE>".$title."</TITLE>";
		
		if (count($css) != 0) {
			for ( $i=0; $i < count($css); $i++) {
				$html .= " 		<link rel='stylesheet' href='".$css[$i]."' type=\"text/css\">";				
			}
		}
		
		//galeria lightBox
		$html .= " 		<link rel='stylesheet' href='css/lytebox.css' type=\"text/css\" media=\"screen\">";				
		
		if (count($js) != 0) {
			for( $i=0; $i < count($js); $i++) {
				$html.="		<script language='JavaScript' src='".$js[$i]."' type='text/javascript'></script>";
			}			
		}

		$html .= "	</HEAD>";
		
		if ((trim($bgColor) != "") || (trim($backGround) != "")) {
			$html .= "	<BODY bgcolor='".$bgColor."' background='".$backGround."' onLoad='setaFocusFirstElement();'>";
		}
		echo $html;
	}

	/**
	* getEndHtml
	*
	* Seta as tags de fechamento do html
	* @return String
	* @access public
	*/
	function getEndHtml() {
		$html = "	</BODY>";
		$html .= "   </HTML>";
		echo $html;
	}
}

?>
